package com.gxy.learn.backup.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@Slf4j
@Component
public class ReadInputConfig {

    @PostConstruct
    public void init() {
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("application.properties");
        try {
            Properties properties = new Properties();
            properties.load(inputStream);
            log.info("properties = {}",properties);
        } catch (IOException e) {
            log.error("读取配置失败！");
        }

    }
}
